using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace Slqj.Data
{
	public static class TableAdminLoginLog
	{
		public const string Table = "AdminLoginLog";
		public const string AdminLoginLogID = "AdminLoginLogID";
		public const string AdministratorID = "AdministratorID";
		public const string LoginID = "LoginID";
		public const string LoginIP = "LoginIP";
		public const string Created = "Created";
	}
	
	[Serializable]
	public class BaseAdminLoginLog
		: IDbSessionEntity, IJsonClass
	{
		int m_AdminLoginLogID;
		/// <summary>
        /// 管理员登录日志ID(主键)
        /// </summary>
        public int AdminLoginLogID
        {
            get { return m_AdminLoginLogID; }
            set { m_AdminLoginLogID = value; }
        }
		
		int m_AdministratorID;
		/// <summary>
        /// 用户帐号表ID
        /// </summary>
        public int AdministratorID
        {
            get { return m_AdministratorID; }
            set { m_AdministratorID = value; }
        }
		
		string m_LoginID;
		/// <summary>
        /// 管理员登录ID
        /// </summary>
        public string LoginID
        {
            get { return m_LoginID; }
            set { m_LoginID = value; }
        }
		
		string m_LoginIP;
		/// <summary>
        /// 登录ID
        /// </summary>
        public string LoginIP
        {
            get { return m_LoginIP; }
            set { m_LoginIP = value; }
        }
		
		DateTime m_Created;
		/// <summary>
        /// 登录时间
        /// </summary>
        public DateTime Created
        {
            get { return m_Created; }
            set { m_Created = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_AdminLoginLogID = reader[TableAdminLoginLog.AdminLoginLogID];
            m_AdministratorID = reader[TableAdminLoginLog.AdministratorID];
            m_LoginID = reader[TableAdminLoginLog.LoginID];
            m_LoginIP = reader[TableAdminLoginLog.LoginIP];
            m_Created = reader[TableAdminLoginLog.Created];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TableAdminLoginLog.AdminLoginLogID, PrimaryKeyType.Identity, AdminLoginLogID);
			writer[TableAdminLoginLog.AdministratorID] = AdministratorID;
			writer[TableAdminLoginLog.LoginID] = LoginID;
			writer[TableAdminLoginLog.LoginIP] = LoginIP;
			writer[TableAdminLoginLog.Created] = Created;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_AdminLoginLogID = idd;
        }
		
		public string TableName
        {
            get { return TableAdminLoginLog.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_AdminLoginLogID = hashToRead["AdminLoginLogID"];
			 
             m_AdministratorID = hashToRead["AdministratorID"];
			 
             m_LoginID = hashToRead["LoginID"];
			 
             m_LoginIP = hashToRead["LoginIP"];
			 
             m_Created = hashToRead["Created"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["AdminLoginLogID"] = AdminLoginLogID;
			 
            hashToFill["AdministratorID"] = AdministratorID;
			 
            hashToFill["LoginID"] = LoginID;
			 
            hashToFill["LoginIP"] = LoginIP;
			 
            hashToFill["Created"] = Created;
			 
        }

        #endregion
		
	}
}
